<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考试题7</title>
</head>

<body>
    <!-- 题目7 -->
    <script>
        // 读题回答打印顺序
        async function async1() {
            console.log(1)
            await async2()
            console.log(2)
        }
        async function async2() {
            return new Promise((resolve, reject) => {
                reject(new Error(''))
            })
        }
        console.log(3)
        setTimeout(function () {
            console.log(4)
        }, 0)
        async1()
        new Promise(function (resolve) {
            console.log(5)
            resolve()
        }).then(function () {
            console.log(6)
        })
        console.log(7)
    </script>
</body>

</html>